/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 */
public class Date {

    public int year;
    public int month ;
     int day;

    public Date(){
        System.out.println("这是无参构造方法");
    }

    public Date(int year,int month,int day){
        this.year = year;
        this.month = month;
        this.day = day;
        System.out.println("这是有参构造方法");
    }

    public static void main(String[] args) {
        Date date = new Date(2004,6,15);
    }
}
/*public class Date {
    //就地初始化
    public int year = 2004;
    public int month = 6;
    public int day = 15;

    public Date(){
        System.out.println(this.year);
        System.out.println(this.month);
        System.out.println(this.day);
    }
    public Date(int year,int month,int day){

    }
    public void printDay(Date this){
        System.out.println(this.year+"年 "+this.month+"月 "+this.day+"日 ");
    }

    public static void main(String[] args) {
        Date date = new Date();
        date.printDay();

    }
}*/
/*
public class Date {
    public int year;
    public int month;
    public int day;

    public Date(){

    }
    public Date(int year,int month,int day){
        this.year = year;
        this.month = month;
        this.day = day;
        System.out.println(this.year);
        System.out.println(this.month);
        System.out.println(this.day);
        System.out.println("这是有参构造方法");
    }
  */
/*  public Date(){
        this(2019,11,23);//必须在第一句
        System.out.println("这是无参构造方法");

        }*//*


    */
/*public Date(int year,int month,int day){
       *//*
*/
/* this(); //不能形成环*//*
*/
/*
        this.year = year;
        this.month = month;
        this.day = day;
        System.out.println("这是有参构造方法");
    }*//*



    public void printDay(Date this){
        System.out.println(this.year+"年 "+this.month+"月 "+this.day+"日 ");
    }

    public static void main(String[] args) {
        Date date = new Date(2004,6,15);
        date.printDay();

    }
}
*/

/*
public class Date {
    public int year;
    public int month;
    public int day;

*/
/*
    public Date(){
        System.out.println("这是无参构造方法");
    }

 *//*

    public Date(int year,int month,int day){
        this.year = year;
        this.month = month;
        this.day = day;
        System.out.println("这是有参构造方法");
    }


 */
/*   this.year = year;//this只能在成员方法中使用
*//*

  */
/*  public void setDay(Date this,int year,int month,int day){
        this.year = year;
        this.month = month;
        this.day = day;
    }*//*

    public void printDay(Date this){
        System.out.println(this.year+"年 "+this.month+"月 "+this.day+"日 ");
    }
    public void test(){
        //this 调用当前对象的成员变量
        this.year = 2019;
        this.month = 11;
        this.day = 23;
        //this 调用当前对象的成员方法
        this.printDay();
    }
    public static void main(String[] args) {

      Date date = new Date();
      */
/*date.setDay(2004,6,15);*//*

      date.printDay();
      //date.test();
     */
/* System.out.println(this.year);//this不能在静态方法中使用*//*


   */
/*   Date date1 = new Date();
      date1.setDay(2004,8,16);
      date1.printDay();

      Date date2 = new Date();
      date2.setDay(2002,12,12);
      date2.printDay();*//*

    }
}
*/

